<?php


namespace app\sys\model;


use think\Model;

class QyeSendLog extends Model
{
    protected $autoWriteTimestamp = true;
    /**
     * @param $staffNo
     * @param $userNo
     * @return string
     *添加发送记录
     */
    public static function addSendLog($staffNo,$userNo):string
    {
        $createDay = strtotime(date("Y-m-d",time()));
        $arr = ["staff_no"=>$staffNo,"user_no"=>$userNo,"create_time"=>time(),"create_day"=>$createDay];
        $logFi = QyeSendLog::where("staff_no",$staffNo)
            ->where("user_no",$userNo)->where("create_day",$createDay)->find();
        if($logFi){
            return "false";
        }
        QyeSendLog::create($arr);
        return "";
    }
}